-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Nu-5490] Expand Custom Action with display policy #5491
[Nu-5490] Expand Custom Action with display policy #5491
Conversation
designer/server/src/main/scala/pl/touk/nussknacker/ui/process/ProcessService.scala
Outdated
Show resolved
Hide resolved
designer/restmodel/src/main/scala/pl/touk/nussknacker/restmodel/definition/package.scala
Outdated
Show resolved
Hide resolved
designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ProcessesResources.scala
Outdated
Show resolved
Hide resolved
sealed trait CustomActionDisplayPolicy | ||
|
||
// TODO: Add more | ||
case object CurrentlyViewedProcessVersionIsDeployed extends CustomActionDisplayPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it is good approach. Those policies seem to be instance-specific, but each NU instance can be configured with different custom actions, different policies.
What happens when I want to add my own custom policy? E.g I want a button that is enabled when scenario diagram contains specified node. Do I need to hardcode it here and in designer/client/src/helpers/customActionDisplayabilityResolver.ts ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answering to your very last question, the answer is yes. If such hardcoded solution cannot be taken into account, the natural improvement is to create some configuration language (implemented using yaml, json, whatever), send it thru' the backend and teach frontend to read it. And of course we should not then use selaed traits.
} ~ path("processes" / ProcessNameSegment / "lastDeployedVersionId") { processName => | ||
processId(processName) { processId => | ||
complete { | ||
processService.getLastDeployedVersionId(processId.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use results of processService.getLatestProcessWithDetails
or processService.getProcessWithDetails
instead of adding new endpoint? See ScenarioWithDetails.lastDeployedAction
, there is some info on current and last deployed version.
Describe your changes
Checklist before merge